import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询积分商品信息列表
export function listPointscommodity(query) {
  return request({
    url: '/business/pointscommodity/list',
    method: 'get',
    params: query
  })
}

// 查询积分商品信息详细
export function getPointscommodity(id) {
  return request({
    url: '/business/pointscommodity/' + parseStrEmpty(id),
    method: 'get'
  })
}

// 新增积分商品信息
export function addPointscommodity(data) {
  return request({
    url: '/business/pointscommodity',
    method: 'post',
    data: data
  })
}

// 修改积分商品信息
export function updatePointscommodity(data) {
  return request({
    url: '/business/pointscommodity',
    method: 'put',
    data: data
  })
}

// 积分商品信息状态修改
export function changePointscommodityStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/business/pointscommodity/changeStatus',
    method: 'put',
    data: data
  })
}

// 删除积分商品信息
export function delPointscommodity(id) {
  return request({
    url: '/business/pointscommodity/' + id,
    method: 'delete'
  })
}
